#ifndef TIME_IIC_H
#define TIME_IIC_H
//#include "stdint.h"
#include "sc95f.h"

#define Rinnai_sec     0x02
#define Rinnai_min     0x03
#define Rinnai_hour    0x04
#define Rinnai_day     0x05
#define Rinnai_week    0x06
#define Rinnai_month   0x07
#define Rinnai_year    0x08
//#define read_addr      0xa3
//#define write_addr     0xa2
#define slave_addr      0x51

#define SCL_624         	 P51
#define SDA_624          	 P11
#define SDA_624_IN       	 P11

#define SCL_650            P17
#define SDA_650	           P16
#define SDA_650_IN      	 P16



typedef struct iic_time
{

	uint8_t iic_register;
	uint8_t iic_sec;
	uint8_t iic_min;
	uint8_t iic_hour;
	uint8_t iic_day;
	uint8_t iic_week;
	uint8_t iic_month;
	uint8_t iic_year;
}IIC_TIME;

typedef struct
{
	uint8_t change_min;
	uint8_t change_hour;
	uint8_t change_week;
	uint8_t change_flag;
}CHANGE_TIME;

extern IIC_TIME iic_time_8563;

extern CHANGE_TIME change_time;

void delay_us(uint8_t timer);
void delay(uint8_t n);
void AiP33624_start(void);
void AiP33624_stop(void);
void AiP33624_write(unsigned char dat);
void write_cmd(unsigned int cmd);
void AiP33624_init(void);
void AiP33624_WriteData(unsigned char addr1,unsigned char dat);
void AiP33624_WriteData1(unsigned char addr1,unsigned char addr2,unsigned char dat);
void AiP33624_WriteData2(unsigned char addr1,unsigned char addr2,unsigned char dat1,unsigned char dat2);
//void AiP33624_all_show`(void);

void AiP650_start(void);
void AiP650_stop(void);
void ack(void);
void AiP650_write(unsigned char dat);
unsigned char AiP650_read(void);
void AiP650_write_cmd(uint16_t cmd);
//void AiP650_display(unsigned char tmp1,unsigned char tmp2,unsigned char tmp3,unsigned char tmp4);
void AiP650_display(unsigned char tmp4,unsigned char tmp1,unsigned char tmp3,unsigned char tmp2);
void AiP650_display_low(unsigned char tmp4,unsigned char tmp1,unsigned char tmp3,unsigned char tmp2);




#endif
